#include <bits/stdc++.h>
using namespace std;
int n, m;
long long f[31][31];
int main() {
    cin >> n >> m;
    f[0][1] = 1;
    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            if (j == 1)
                f[i][j] = f[i - 1][j + 1] + f[i - 1][n];
            else if (j == n)
                f[i][j] = f[i - 1][1] + f[i - 1][n - 1];
            else
                f[i][j] = f[i - 1][j - 1] + f[i - 1][j + 1];
        }
    }

    cout << f[m][1];

    return 0;
}